import {router} from "./index";
import { getToken } from "../utils/auth";
const WHITE_LIST=["/login","/404"]
console.log(router,"router");
router.beforeEach((to,from,next)=>{
    const token=getToken();
    if(token){
        next()
    }else{
        if(WHITE_LIST.includes(to.path)){
            next()
        }else{
            next("/login")
        }
    }

})